import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import Routers from './router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import lrz from 'lrz'
import { Lazyload } from 'vant';
Vue.use(VueRouter)
Vue.use(VueAxios, axios)
Vue.use(Lazyload, {
	preLoad: 1,
	error: 'http://bjfile.baijintour.com/upload/20180417/2ddf970cd9d64a1a845348cef790efc7.jpg',
	loading: 'http://bjfile.baijintour.com/upload/20180417/2ddf970cd9d64a1a845348cef790efc7.jpg',
	attempt: 1
  })

//定义路由
const RouterConfig = {
  //mode: 'history',
  routes: Routers
}

axios.defaults.withCredentials = true //

const router = new VueRouter(RouterConfig)
//添加Fastclick移除移动端点击延迟
const FastClick = require('fastclick')
FastClick.attach(document.body)
Vue.config.productionTip = false

//注册一个title全局指令
Vue.directive('title', {
  inserted: function (el, binding) {
    document.title = el.innerText
    el.remove()
  }
})
// 路由配置
new Vue({
  el: '#app',
  router:router,
  render: h => h(App)
}).$mount('#app')
